<template>
  <star-horse-dialog :title = "dialogTitle" :visible = "batchDialogTableVisible" @merge = "merge"
                     @mergeDraft = "mergeDraft"
                     @reset = "resetForm"
                     is-batch = "true">
    <el-form :model = "ruleForm" :rules = "rules" class = "demo-ruleForm" ref = "ruleForm">
      <el-table
          :data = "ruleForm.batchDataList"
          :row-class-name = "rowClassName"
          @selection-change = "handleDetailSelectionChange"
          border
          fit = "true"
          ref = "tb"
          v-loading = "loading"
      >
        <el-table-column align = "center" fixed = "left" type = "selection" width = "50"/>
        <el-table-column align = "center" label = "序号" prop = "xh" width = "80"></el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "主键"
            min-width = "200px"
            prop = "idComplianceReport"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.idComplianceReport'"
                          :rules = "rules.idComplianceReport"
                          required>
              <el-input clearable placeholder = "请输入主键"
                        v-model = "scope.row.idComplianceReport"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "主键"
            min-width = "200px"
            prop = "idNodeProperty"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.idNodeProperty'" :rules = "rules.idNodeProperty"
                          required>
              <el-input clearable placeholder = "请输入主键"
                        v-model = "scope.row.idNodeProperty"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "致命总数"
            min-width = "200px"
            prop = "blocker"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.blocker'" :rules = "rules.blocker" required>
              <el-input clearable placeholder = "请输入致命总数"
                        v-model = "scope.row.blocker"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "严重总数"
            min-width = "200px"
            prop = "critical"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.critical'" :rules = "rules.critical"
                          required>
              <el-input clearable placeholder = "请输入严重总数"
                        v-model = "scope.row.critical"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "中度总数"
            min-width = "200px"
            prop = "major"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.major'" :rules = "rules.major" required>
              <el-input clearable placeholder = "请输入中度总数"
                        v-model = "scope.row.major"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "轻微总数"
            min-width = "200px"
            prop = "minor"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.minor'" :rules = "rules.minor" required>
              <el-input clearable placeholder = "请输入轻微总数"
                        v-model = "scope.row.minor"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "Info总数"
            min-width = "200px"
            prop = "infos"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.infos'" :rules = "rules.infos" required>
              <el-input clearable placeholder = "请输入Info总数"
                        v-model = "scope.row.infos"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "重复率"
            min-width = "200px"
            prop = "repeatRate"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.repeatRate'" :rules = "rules.repeatRate"
                          required>
              <el-input-number :precision = "4" :step = "0.1"
                               clearable placeholder = "请输入重复率"
                               v-model = "scope.row.repeatRate"/>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "重复代码行"
            min-width = "200px"
            prop = "repeatCodeLines"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.repeatCodeLines'" :rules = "rules.repeatCodeLines"
                          required>
              <el-input clearable placeholder = "请输入重复代码行"
                        v-model = "scope.row.repeatCodeLines"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "重复代码块"
            min-width = "200px"
            prop = "repeatCodeBlock"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.repeatCodeBlock'" :rules = "rules.repeatCodeBlock"
                          required>
              <el-input clearable placeholder = "请输入重复代码块"
                        v-model = "scope.row.repeatCodeBlock"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "重复文件"
            min-width = "200px"
            prop = "repeatFiles"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.repeatFiles'" :rules = "rules.repeatFiles"
                          required>
              <el-input clearable placeholder = "请输入重复文件"
                        v-model = "scope.row.repeatFiles"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "总复杂度"
            min-width = "200px"
            prop = "totalComplex"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.totalComplex'" :rules = "rules.totalComplex"
                          required>
              <el-input clearable placeholder = "请输入总复杂度"
                        v-model = "scope.row.totalComplex"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "文件平均复杂度"
            min-width = "200px"
            prop = "fileAvgComplex"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.fileAvgComplex'" :rules = "rules.fileAvgComplex"
                          required>
              <el-input clearable placeholder = "请输入文件平均复杂度"
                        v-model = "scope.row.fileAvgComplex"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "详情地址"
            min-width = "200px"
            prop = "detailUrls"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.detailUrls'" :rules = "rules.detailUrls"
                          required>
              <el-input clearable placeholder = "请输入详情地址"
                        v-model = "scope.row.detailUrls"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "修改人"
            min-width = "200px"
            prop = "updatedBy"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.updatedBy'" :rules = "rules.updatedBy">
              <el-input clearable placeholder = "请输入修改人"
                        v-model = "scope.row.updatedBy"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "修改时间"
            min-width = "200px"
            prop = "updatedDate"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.updatedDate'" :rules = "rules.updatedDate">
              <el-date-picker clearable placeholder = "请选择修改时间"
                              type = "date"
                              v-model = "scope.row.updatedDate">
              </el-date-picker>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "创建人"
            min-width = "200px"
            prop = "createdBy"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.createdBy'" :rules = "rules.createdBy">
              <el-input clearable placeholder = "请输入创建人"
                        v-model = "scope.row.createdBy"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "创建时间"
            min-width = "200px"
            prop = "createdDate"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.createdDate'" :rules = "rules.createdDate">
              <el-date-picker clearable placeholder = "请选择创建时间"
                              type = "date"
                              v-model = "scope.row.createdDate">
              </el-date-picker>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "数据编号"
            min-width = "200px"
            prop = "dataNo"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.dataNo'" :rules = "rules.dataNo">
              <el-input clearable placeholder = "请输入数据编号"
                        v-model = "scope.row.dataNo"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "是否删除 1 是 2 否 默认2"
            min-width = "200px"
            prop = "isDel"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.isDel'" :rules = "rules.isDel">
              <el-input clearable placeholder = "请输入是否删除 1 是 2 否 默认2"
                        v-model = "scope.row.isDel"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "状态名称"
            min-width = "200px"
            prop = "statusName"
            v-if = " false "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.statusName'" :rules = "rules.statusName">
              <el-input clearable placeholder = "请输入状态名称"
                        v-model = "scope.row.statusName"></el-input>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column
            :formatter = "dataFormat"
            label = "状态编码"
            min-width = "200px"
            prop = "statusCode"
            v-if = "true "
        >
          <template #default = "scope">
            <el-form-item :prop = "'batchDataList.'+scope.$index+'.statusCode'" :rules = "rules.statusCode"
                          required>
              <el-select clearable placeholder = "请选择状态" v-model = "scope.row.statusCode">
                <el-option
                    :key = "sitem.statusCode"
                    :label = "sitem.statusName"
                    :value = "sitem.statusCode"
                    v-for = "sitem in selectData"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column fixed = "right" label = "操作" min-width = "150px">
          <template #header = "scope">
            <span>操作</span>&nbsp;&nbsp;
            <el-button @click = "handleAddDetails(scope.row,1)" link size = "mini" type = "primary">
              <el-tooltip content = "添加一行">
                <user-icon icon = "plus" style = "vertical-align: middle;color:#409EFF;"/>
              </el-tooltip>
            </el-button>
          </template>
          <template #default = "scope">
            <el-button @click = "handleAddDetails(scope.row,1)" link size = "mini" type = "primary">
              <el-tooltip content = "添加一行">添加</el-tooltip>
            </el-button>
            <el-button @click = "handleAddDetails(scope.row,2)" link size = "mini" type = "danger">
              <el-tooltip content = "删除当前行">删除</el-tooltip>
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-form>
  </star-horse-dialog>
  <star-horse-dialog :title = "dialogTitle" :visible = "dialogTableVisible" @merge = "merge" @mergeDraft = "mergeDraft"
                     @reset = "resetForm">
    <el-form :model = "ruleForm" :rules = "rules" class = "demo-ruleForm" ref = "ruleForm">
      <el-form-item label = "主键" prop = "idComplianceReport" v-if = "false">
        <el-input clearable placeholder = "请输入主键"
                  v-model = "ruleForm.idComplianceReport"></el-input>
      </el-form-item>

      <el-form-item label = "主键" prop = "idNodeProperty"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入主键"
                         v-model = "ruleForm.idNodeProperty"/>
      </el-form-item>

      <el-form-item label = "致命总数" prop = "blocker"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入致命总数"
                         v-model = "ruleForm.blocker"/>
      </el-form-item>

      <el-form-item label = "严重总数" prop = "critical"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入严重总数"
                         v-model = "ruleForm.critical"/>
      </el-form-item>

      <el-form-item label = "中度总数" prop = "major"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入中度总数"
                         v-model = "ruleForm.major"/>
      </el-form-item>

      <el-form-item label = "轻微总数" prop = "minor"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入轻微总数"
                         v-model = "ruleForm.minor"/>
      </el-form-item>

      <el-form-item label = "Info总数" prop = "infos"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入Info总数"
                         v-model = "ruleForm.infos"/>
      </el-form-item>

      <el-form-item label = "重复率" prop = "repeatRate"
                    required v-if = "!false">
        <el-input-number :precision = "4" :step = "0.1" clearable
                         placeholder = "请输入重复率"
                         v-model = "ruleForm.repeatRate"/>
      </el-form-item>

      <el-form-item label = "重复代码行" prop = "repeatCodeLines"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入重复代码行"
                         v-model = "ruleForm.repeatCodeLines"/>
      </el-form-item>

      <el-form-item label = "重复代码块" prop = "repeatCodeBlock"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入重复代码块"
                         v-model = "ruleForm.repeatCodeBlock"/>
      </el-form-item>

      <el-form-item label = "重复文件" prop = "repeatFiles"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入重复文件"
                         v-model = "ruleForm.repeatFiles"/>
      </el-form-item>

      <el-form-item label = "总复杂度" prop = "totalComplex"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入总复杂度"
                         v-model = "ruleForm.totalComplex"/>
      </el-form-item>

      <el-form-item label = "文件平均复杂度" prop = "fileAvgComplex"
                    required v-if = "!false">
        <el-input-number clearable placeholder = "请输入文件平均复杂度"
                         v-model = "ruleForm.fileAvgComplex"/>
      </el-form-item>

      <el-form-item label = "详情地址" prop = "detailUrls"
                    required v-if = "!false">
        <el-input clearable placeholder = "请输入详情地址"
                  v-model = "ruleForm.detailUrls"></el-input>
      </el-form-item>

      <el-form-item label = "修改人" prop = "updatedBy"
                    v-if = "!true">
        <el-input clearable placeholder = "请输入修改人"
                  v-model = "ruleForm.updatedBy"></el-input>
      </el-form-item>

      <el-form-item label = "修改时间" prop = "updatedDate"
                    v-if = "!true">
        <el-date-picker clearable placeholder = "请选择修改时间" type = "date"
                        v-model = "ruleForm.updatedDate">
        </el-date-picker>
      </el-form-item>

      <el-form-item label = "创建人" prop = "createdBy"
                    v-if = "!true">
        <el-input clearable placeholder = "请输入创建人"
                  v-model = "ruleForm.createdBy"></el-input>
      </el-form-item>

      <el-form-item label = "创建时间" prop = "createdDate"
                    v-if = "!true">
        <el-date-picker clearable placeholder = "请选择创建时间" type = "date"
                        v-model = "ruleForm.createdDate">
        </el-date-picker>
      </el-form-item>

      <el-form-item label = "数据编号" prop = "dataNo"
                    v-if = "!true">
        <el-input clearable placeholder = "请输入数据编号"
                  v-model = "ruleForm.dataNo"></el-input>
      </el-form-item>

      <el-form-item label = "是否删除 1 是 2 否 默认2" prop = "isDel"
                    v-if = "!true">
        <el-input-number clearable placeholder = "请输入是否删除 1 是 2 否 默认2"
                         v-model = "ruleForm.isDel"/>
      </el-form-item>

      <el-form-item label = "状态名称" prop = "statusName"
                    v-if = "!true">
        <el-input clearable placeholder = "请输入状态名称"
                  v-model = "ruleForm.statusName"></el-input>
      </el-form-item>

      <el-form-item label = "状态编码" prop = "statusCode"
                    required v-if = "!false">
        <el-select placeholder = "请选择状态编码" v-model = "ruleForm.statusCode">
          <el-option
              :key = "sitem.statusCode"
              :label = "sitem.statusName"
              :value = "sitem.statusCode"
              clearable
              v-for = "sitem in selectData"
          >
          </el-option>
        </el-select>
      </el-form-item>

    </el-form>
  </star-horse-dialog>
  <star-horse-dialog :is-view = "true" :title = "'查看数据'" :visible = "viewVisible">
    <el-form :model = "ruleForm" class = "view-ruleForm" label-width = "15%" ref = "ruleForm">
      <el-form-item label = "主键" prop = "idComplianceReport">
        <span>{{ ruleForm.idComplianceReport }}</span>
      </el-form-item>
      <el-form-item label = "主键" prop = "idNodeProperty">
        <span>{{ ruleForm.idNodeProperty }}</span>
      </el-form-item>
      <el-form-item label = "致命总数" prop = "blocker">
        <span>{{ ruleForm.blocker }}</span>
      </el-form-item>
      <el-form-item label = "严重总数" prop = "critical">
        <span>{{ ruleForm.critical }}</span>
      </el-form-item>
      <el-form-item label = "中度总数" prop = "major">
        <span>{{ ruleForm.major }}</span>
      </el-form-item>
      <el-form-item label = "轻微总数" prop = "minor">
        <span>{{ ruleForm.minor }}</span>
      </el-form-item>
      <el-form-item label = "Info总数" prop = "infos">
        <span>{{ ruleForm.infos }}</span>
      </el-form-item>
      <el-form-item label = "重复率" prop = "repeatRate">
        <span>{{ ruleForm.repeatRate }}</span>
      </el-form-item>
      <el-form-item label = "重复代码行" prop = "repeatCodeLines">
        <span>{{ ruleForm.repeatCodeLines }}</span>
      </el-form-item>
      <el-form-item label = "重复代码块" prop = "repeatCodeBlock">
        <span>{{ ruleForm.repeatCodeBlock }}</span>
      </el-form-item>
      <el-form-item label = "重复文件" prop = "repeatFiles">
        <span>{{ ruleForm.repeatFiles }}</span>
      </el-form-item>
      <el-form-item label = "总复杂度" prop = "totalComplex">
        <span>{{ ruleForm.totalComplex }}</span>
      </el-form-item>
      <el-form-item label = "文件平均复杂度" prop = "fileAvgComplex">
        <span>{{ ruleForm.fileAvgComplex }}</span>
      </el-form-item>
      <el-form-item label = "详情地址" prop = "detailUrls">
        <span>{{ ruleForm.detailUrls }}</span>
      </el-form-item>
      <el-form-item label = "修改人" prop = "updatedBy">
        <span>{{ ruleForm.updatedBy }}</span>
      </el-form-item>
      <el-form-item label = "修改时间" prop = "updatedDate">
        <span>{{ ruleForm.updatedDate }}</span>
      </el-form-item>
      <el-form-item label = "创建人" prop = "createdBy">
        <span>{{ ruleForm.createdBy }}</span>
      </el-form-item>
      <el-form-item label = "创建时间" prop = "createdDate">
        <span>{{ ruleForm.createdDate }}</span>
      </el-form-item>
      <el-form-item label = "数据编号" prop = "dataNo">
        <span>{{ ruleForm.dataNo }}</span>
      </el-form-item>
      <el-form-item label = "是否删除 1 是 2 否 默认2" prop = "isDel">
        <span>{{ ruleForm.isDel }}</span>
      </el-form-item>
      <el-form-item label = "状态名称" prop = "statusName">
        <span>{{ ruleForm.statusName }}</span>
      </el-form-item>
      <el-form-item label = "状态编码" prop = "statusCode">
        <span>{{ ruleForm.statusCode }}</span>
      </el-form-item>
    </el-form>
  </star-horse-dialog>
  <el-card>
    <el-form class = "search_area" size = "default">
      <el-form-item label = "状态名称">
        <el-input placeholder = "请输入状态名称" v-model = "searchForm.statusName"/>
      </el-form-item>
      <el-form-item label = "添加时间">
        <el-date-picker
            end-placeholder = "结束日期" placeholder = "请选择添加时间"
            range-separator = "到"
            start-placeholder = "开始日期"
            type = "daterange"
            v-model = "searchForm.createdDate"
        />
      </el-form-item>
      <el-form-item label = "     ">
        <el-button @click = "dataSearch" link type = "primary">
          <user-icon icon = "search"/>
          <span style = "vertical-align: middle;"> 查询 </span>
        </el-button>
        <el-button @click = "dataSearch(1)" link small>
          <span style = "vertical-align: middle;"> 重置 </span>
        </el-button>
      </el-form-item>
    </el-form>
    <el-divider/>
    <ul class = "inner_button">
      <li v-if = "permission.add">
        <el-button @click = "btnOperation(1)" link title = "" type = "primary">
          <user-icon icon = "plus"/>
          <el-tooltip content = "新增">新增</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.batchAdd">
        <el-button @click = "btnOperation(11)" link title = "" type = "primary">
          <user-icon icon = "plus-square"/>
          <el-tooltip content = "批量新增">批量新增</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.delete">
        <el-button @click = "btnOperation(4)" link title = "" type = "danger">
          <user-icon icon = "minus-square"/>
          <el-tooltip content = "批量删除">批量删除</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.view">
        <el-button @click = "btnOperation(5)" link title = "" type = "primary">
          <user-icon icon = "sync"/>
          <el-tooltip content = "刷新">刷新</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.download">
        <el-button @click = "btnOperation(6)" link title = "" type = "primary">
          <user-icon icon = "file-download"/>
          <el-tooltip content = "下载模板">下载模板</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.execution">
        <el-button @click = "btnOperation(7)" link title = "" type = "primary">
          <user-icon icon = "play-circle"/>
          <el-tooltip content = "执行">执行</el-tooltip>
        </el-button>
      </li>
      <li v-if = "permission.upload">
        <el-upload
            :action = "uploadUrl"
            :auto-upload = "true"
            :on-change = "upload"
            :on-error = "uploadError"
            :on-progress = "uploadProcess"
            :on-success = "uploadSuccess"
            :show-file-list = "false"
            class = "upload-demo"
            name = "file"
        >
          <el-button link title = "" type = "primary">
            <user-icon icon = "file-upload"/>
            <el-tooltip content = "上传">上传</el-tooltip>
          </el-button>

        </el-upload>
      </li>
      <li v-if = "permission.export">
        <el-button @click = "btnOperation(8)" link title = "" type = "primary">
          <user-icon icon = "file-export"/>
          <el-tooltip content = "导出">导出</el-tooltip>
        </el-button>
      </li>
    </ul>
    <el-table
        :data = "dataList"
        :row-key = "getRowIdentity"
        @row-dblclick = "editData"
        @selection-change = "handleSelectionChange"
        border
        fit = "true"
        highlight-current-row = "true"
        id = "complianceScanReport"
        ref = "multipleTable"
        stripe = "true"
    >
      <el-table-column fixed width = "1"/>
      <el-table-column
          :reserve-selection = "true"
          align = "center"
          fixed = "left"
          type = "selection"
      />
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "主键"
          min-width = "200px"
          prop = "idComplianceReport"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "主键"
          min-width = "200px"
          prop = "idNodeProperty"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "致命总数"
          min-width = "200px"
          prop = "blocker"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "严重总数"
          min-width = "200px"
          prop = "critical"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "中度总数"
          min-width = "200px"
          prop = "major"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "轻微总数"
          min-width = "200px"
          prop = "minor"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "Info总数"
          min-width = "200px"
          prop = "infos"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "重复率"
          min-width = "200px"
          prop = "repeatRate"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "重复代码行"
          min-width = "200px"
          prop = "repeatCodeLines"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "重复代码块"
          min-width = "200px"
          prop = "repeatCodeBlock"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "重复文件"
          min-width = "200px"
          prop = "repeatFiles"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "总复杂度"
          min-width = "200px"
          prop = "totalComplex"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "文件平均复杂度"
          min-width = "200px"
          prop = "fileAvgComplex"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "详情地址"
          min-width = "200px"
          prop = "detailUrls"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "修改人"
          min-width = "200px"
          prop = "updatedBy"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "修改时间"
          min-width = "200px"
          prop = "updatedDate"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "创建人"
          min-width = "200px"
          prop = "createdBy"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "创建时间"
          min-width = "200px"
          prop = "createdDate"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "数据编号"
          min-width = "200px"
          prop = "dataNo"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "是否删除 1 是 2 否 默认2"
          min-width = "200px"
          prop = "isDel"
          v-if = " false ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "状态名称"
          min-width = "200px"
          prop = "statusName"
          v-if = "true ">
      </el-table-column>
      <el-table-column
          :formatter = "dataFormat"
          :show-overflow-tooltip = "true"
          label = "状态编码"
          min-width = "200px"
          prop = "statusCode"
          v-if = " false ">
      </el-table-column>
      <el-table-column fixed = "right" label = "操作" min-width = "180px">
        <template #default = "scope">
          <el-button @click = "editById(scope.row[primaryKey])" link title = "" type = "primary"
                     v-if = "permission.edit">
            <el-tooltip content = "编辑">编辑</el-tooltip>
          </el-button>
          <el-button @click = "viewById(scope.row[primaryKey])" link title = "" type = "primary"
                     v-if = "permission.view">
            <el-tooltip content = "查看">查看</el-tooltip>
          </el-button>
          <el-button @click = "deleteById(scope.row[primaryKey])" link title = "" type = "danger"
                     v-if = "permission.delete">
            <el-tooltip content = "删除">删除</el-tooltip>
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-divider/>
    <el-pagination
        :total = "totalData"
        @current-change = "pageChangeClick"
        @size-change = "pageSizeClick"
        layout = "total, sizes, prev, pager, next, jumper"
        v-model:currentPage = "currentPage"
        v-model:page-size = "pageSize"
        v-model:pageCount = "totalPage"/>
  </el-card>
</template>
<style lang = "scss" scoped>

</style>
<script>

import {ref} from "vue";
import {common} from "../../api/common";

export default {
  name: "ComplianceScanReport",

  mixins: [common],
  setup() {
    return {}
  },
  data() {
    const loadByPageUrl = ref("/devops-continus/continus/complianceScanReport/pageList");
    const mergeUrl = ref("/devops-continus/continus/complianceScanReport/merge");
    const mergeDraftUrl = ref("/devops-continus/continus/complianceScanReport/mergeDraft");
    const batchMergeUrl = ref("/devops-continus/continus/complianceScanReport/mergeBatch");
    const batchMergeDraftUrl = ref("/devops-continus/continus/complianceScanReport/mergeBatchDraft");
    const loadByIdUrl = ref("/devops-continus/continus/complianceScanReport/getById");
    const deleteUrl = ref("/devops-continus/continus/complianceScanReport/batchDeleteByIdLogic");
    const exportAllUrl = ref("/devops-continus/continus/complianceScanReport/exportData");
    const downloadTemplateUrl = ref("/devops-continus/continus/complianceScanReport/downloadTemplate");
    const uploadUrl = ref("/devops-continus/continus/complianceScanReport/importData");
    const userConditionUrl = ref("/devops-continus/continus/complianceScanReport/getAllByCondition");
    const primaryKey = "idComplianceReport";
    return {
      loadByPageUrl,
      mergeUrl,
      mergeDraftUrl,
      batchMergeUrl,
      batchMergeDraftUrl,
      loadByIdUrl,
      deleteUrl,
      exportAllUrl,
      downloadTemplateUrl,
      uploadUrl,
      userConditionUrl,
      primaryKey
    }
  },
  methods: {
    dataFormat(row, column, cellValue, index) {
      cellValue = this.commonDataFormat(row, column, cellValue, index);
      return cellValue;
    },
    /**
     * 初始化数据
     */
    init: function () {
      this.dataList = [];
      this.selectData = [];
      this.loadByPage(this.currentPage, this.pageSize);
      this.loadPermissionResources();
      this.commonSelectData("cts_compliance_scan_report");
    },

    parseSearchData: function () {
      let data = this.searchForm;
      let arr = [];
      if (data.statusName) {
        arr.push({
          propertyName: "statusName",
          value: data.statusName,
          operation: "lk"
        });
      }
      if (data.createdDate) {
        arr.push({
          propertyName: "createdDate",
          value: data.createdDate,
          operation: "bt"
        });
      }
      return arr;
    }
  },
  created() {
    this.init();
  }
}
</script>